import vue from '@vitejs/plugin-vue'

import createCompression from './compression'
import createComponents from './components.js'
import autoImport from './auto-import.js'

export default function createVitePlugins(viteEnv, isBuild = false) {
    const vitePlugins = [vue()]
    vitePlugins.push(createComponents())
    vitePlugins.push(autoImport())
	isBuild && vitePlugins.push(...createCompression(viteEnv))
    return vitePlugins
}
